// 懒加载  使用懒加载时所有的懒加载组件都要放在 SusPense 节点中
import { lazy } from 'react';

import { RouteObject, Navigate } from 'react-router-dom';

const HomeIndex = lazy(() => import('../views/home/index'));
const DiscoverIndex = lazy(() => import('../views/discover/index'));
const MineIndex = lazy(() => import('../views/mine/index'));
const LoginIndex = lazy(() => import('../views/login/index'));

const routes: RouteObject[] = [
    {
        path: '/',
        element: <Navigate to="/home" />
    },
    {
        path: '/home',
        element: <HomeIndex />
    },
    {
        path: '/discover',
        element: <DiscoverIndex />
    },
    {
        path: '/mine',
        element: <MineIndex />
    },
    {
        path: '/login',
        element: <LoginIndex />
    }
];

export default routes;
